<?php
class PersonaTelefono extends AppModel {
	var $name = 'PersonaTelefono';
	var $useTable = 'personas_telefonos';
	var $validate = array(
		'id' => array(
			'blank' => array(
				'rule' => array('blank'),
				'on' => 'create' 
			)
		),
		'persona_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'codigoLDI' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '3')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'codigoLDN' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '4')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'telefono' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '9')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'extension' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '5')
			)
		),
		'created' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'tipo_telefono_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		)
	);

	var $belongsTo = array(
		'Persona' => array(
			'className' => 'Persona',
			'foreignKey' => 'persona_id'
		),
		'TipoTelefono' => array(
			'className' => 'TipoTelefono',
			'foreignKey' => 'tipo_telefono_id'
		)
	);
}
?>